package com.cxb.entity;

public class MqttEventBean {

	// 事件类型（定时上报） | imei | 地磁X | 地磁Y | 地磁Z | gsensor.x | gsensor.y | gsensor.z |
	// 航向角 | gsensor.status | 瞬时速度 | 经度 | 纬度 | 海拔 | 定位类型 | PDOP综合位置精度因子 |
	// HDOP水平精度因子 | VDOP垂直精度因子 | GPS时间 | 终端创建时间

	private int eventType;
	private String imei;
	private float magneticX = Integer.MIN_VALUE;
	private float magneticY = Integer.MIN_VALUE;
	private float magneticZ = Integer.MIN_VALUE;
	private float gsensorX = Integer.MIN_VALUE;

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	private float gsensorY = Integer.MIN_VALUE;
	private float gsensorZ = Integer.MIN_VALUE;
	private float angle = Integer.MIN_VALUE;
	private int gsensorStatus = Integer.MIN_VALUE;
	private float speed = Integer.MIN_VALUE;
	private double lat = Integer.MIN_VALUE;
	private double lng = Integer.MIN_VALUE;
	private float height = -1;
	private int gpsMode = -1;
	private float pdop = -1;
	private float vdop = -1;
	private float hdop = -1;
	private long gpsTime = -1;
	private long time = -1;
	private String latFlag = null;
	private String phoneNumber = null;
	private String version = null;

	public int getEventType() {
		return eventType;
	}

	public void setEventType(int eventType) {
		this.eventType = eventType;
	}

	public String getImei() {
		return imei;
	}

	public void setImei(String imei) {
		this.imei = imei;
	}

	public float getMagneticX() {
		return magneticX;
	}

	public void setMagneticX(float magneticX) {
		this.magneticX = magneticX;
	}

	public float getMagneticY() {
		return magneticY;
	}

	public void setMagneticY(float magneticY) {
		this.magneticY = magneticY;
	}

	public float getMagneticZ() {
		return magneticZ;
	}

	public void setMagneticZ(float magneticZ) {
		this.magneticZ = magneticZ;
	}

	public float getGsensorX() {
		return gsensorX;
	}

	public void setGsensorX(float gsensorX) {
		this.gsensorX = gsensorX;
	}

	public float getGsensorY() {
		return gsensorY;
	}

	public void setGsensorY(float gsensorY) {
		this.gsensorY = gsensorY;
	}

	public float getGsensorZ() {
		return gsensorZ;
	}

	public void setGsensorZ(float gsensorZ) {
		this.gsensorZ = gsensorZ;
	}

	public float getAngle() {
		return angle;
	}

	public void setAngle(float angle) {
		this.angle = angle;
	}

	public int getGsensorStatus() {
		return gsensorStatus;
	}

	public void setGsensorStatus(int gsensorStatus) {
		this.gsensorStatus = gsensorStatus;
	}

	public float getSpeed() {
		return speed;
	}

	public void setSpeed(float speed) {
		this.speed = speed;
	}

	public double getLat() {
		return lat;
	}

	public void setLat(double lat) {
		this.lat = lat;
	}

	public double getLng() {
		return lng;
	}

	public void setLng(double lng) {
		this.lng = lng;
	}

	public float getHeight() {
		return height;
	}

	public void setHeight(float height) {
		this.height = height;
	}

	public int getGpsMode() {
		return gpsMode;
	}

	public void setGpsMode(int gpsMode) {
		this.gpsMode = gpsMode;
	}

	public float getPdop() {
		return pdop;
	}

	public void setPdop(float pdop) {
		this.pdop = pdop;
	}

	public float getVdop() {
		return vdop;
	}

	public void setVdop(float vdop) {
		this.vdop = vdop;
	}

	public float getHdop() {
		return hdop;
	}

	public void setHdop(float hdop) {
		this.hdop = hdop;
	}

	public long getGpsTime() {
		return gpsTime;
	}

	public void setGpsTime(long gpsTime) {
		this.gpsTime = gpsTime;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}

	public String getLatFlag() {
		return latFlag;
	}

	public void setLatFlag(String latFlag) {
		this.latFlag = latFlag;
	}

	public String getLngFlag() {
		return lngFlag;
	}

	public void setLngFlag(String lngFlag) {
		this.lngFlag = lngFlag;
	}

	private String lngFlag = null;

	public String getCommandString() {
		String str = eventType + "|" + imei;
		if (magneticX > Integer.MIN_VALUE) {
			str += "|" + magneticX;
		} else {
			str += "|";
		}
		if (magneticY > Integer.MIN_VALUE) {
			str += "|" + magneticY;
		} else {
			str += "|";
		}
		if (magneticZ > Integer.MIN_VALUE) {
			str += "|" + magneticZ;
		} else {
			str += "|";
		}
		if (gsensorX > Integer.MIN_VALUE) {
			str += "|" + gsensorX;
		} else {
			str += "|";
		}
		if (gsensorY > Integer.MIN_VALUE) {
			str += "|" + gsensorY;
		} else {
			str += "|";
		}
		if (gsensorZ > Integer.MIN_VALUE) {
			str += "|" + gsensorZ;
		} else {
			str += "|";
		}
		if (angle >= 0) {
			str += "|" + angle;
		} else {
			str += "|";
		}
		if (gsensorStatus > Integer.MIN_VALUE) {
			str += "|" + gsensorStatus;
		} else {
			str += "|";
		}
		if (speed > Integer.MIN_VALUE) {
			str += "|" + speed;
		} else {
			str += "|";
		}
		if (lng >= 0) {
			str += "|" + lng;
		} else {
			str += "|";
		}
		if (lat > Integer.MIN_VALUE) {
			str += "|" + lat;
		} else {
			str += "|";
		}
		if (height >= 0) {
			str += "|" + height;
		} else {
			str += "|";
		}
		if (gpsMode >= 0) {
			str += "|" + gpsMode;
		} else {
			str += "|";
		}
		if (pdop >= 0) {
			str += "|" + pdop;
		} else {
			str += "|";
		}
		if (vdop >= 0) {
			str += "|" + vdop;
		} else {
			str += "|";
		}
		if (hdop >= 0) {
			str += "|" + hdop;
		} else {
			str += "|";
		}
		if (gpsTime >= 0) {
			str += "|" + gpsTime;
		} else {
			str += "|";
		}
		if (time >= 0) {
			str += "|" + time;
		} else {
			str += "|";
		}
		if (lngFlag != null) {
			str += "|" + lngFlag;
		} else {
			str += "|";
		}
		if (latFlag != null) {
			str += "|" + latFlag;
		} else {
			str += "|";
		}
		if (phoneNumber != null) {
			str += "|" + phoneNumber;
		} else {
			str += "|";
		}
		if (version != null) {
			str += "|" + version;
		} else {
			str += "|";
		}
		return str;

	}

}
